package com.example.smartlearning.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.smartlearning.entity.NewEntity;

import java.util.List;

public interface NewDao extends BaseMapper<NewEntity> {
    List<NewEntity> selectAllNew(int start, int limit);//在新闻详情页查询所有的新闻

    NewEntity selectNewId(int newId);//根据新闻id获取详细信息

    List<NewEntity> selectByUser(String interest);//根据用户感兴趣的内容查询新闻  用于首页展示

    NewEntity selectNewDetail(int newId);//根据新闻id获取详情

    String updateNewById(int newId, String newTitle, String newDetail, String createTime, String newSort, String newInImg, String newImg);//更新某条新闻

    String addNew(String newTitle, String newDetail, String createTime, String newSort, int newUser, String newInImg, String newImg);//插入一条新闻

    String deleteByNewId(int id);//删除一条新闻
}
